import java.util.Scanner;
public class GoodsMain {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        System.out.println("*******欢迎进入商品批发市场******");
        String goods[]={"电风扇","洗衣机","电视机","冰箱","空调机"};
        double prices[]={124.23,4500.0,8800.9,5000.88,4456.0};
        System.out.println("编号"+"\t"+"商品"+"\t\t"+"价格");
        for (int i = 0; i < 5; i++) {
            System.out.println(i+"\t\t"+goods[i]+"\t\t"+prices[i]);
        }
        System.out.println("*********************************");
        System.out.println("请输入您批发的商品编号：");
        int choose01=sc.nextInt();
        System.out.println("请输入批发数量：");
        int choose02= sc.nextInt();
        Double total=new Double(choose02*prices[choose01-1]);
        StringBuffer strTotal=new StringBuffer(total.toString());
        for (int i = strTotal.indexOf("."); i >0 ; i-=3) {
            strTotal.insert(i,",");
        }
        strTotal.delete(strTotal.indexOf(".")-1,strTotal.indexOf("."));
        System.out.println("您需要付款："+strTotal);
    }
}

